<template>
	<view class="applicationDetail">
		<view class="DetailBox_top">
			<image src="../../static/image/wdsqimg.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
			<view class="" style="margin-left: 20rpx;">
				国家：{{pageData.country}}
			</view>
		</view>

		<view class="detailMessageBox" v-for="(item,index) in pageData.information">
			<view class="detailItem">
				<view class="lable">
					学校
				</view>
				<view class="value">
					{{item.school}}
				</view>
			</view>
			<view class="detailItem">
				<view class="lable">
					专业
				</view>
				<view class="value">
					{{item.speciality}}
				</view>
			</view>
			<view class="detailItem">
				<view class="lable">
					状态
				</view>

				<view v-if="item.status == 0" class="value" style="color: #8BBEFD;">
					未开始
				</view>
				<view v-if="item.status == 1" class="value" style="color: #27D8A6;">
					进行中
				</view>
				<view v-if="item.status == 2" class="value" style="color: #FF6F6F;">
					已提交
				</view>
			</view>
			<view class="detailItem">
				<view class="lable">
					申请截止日期
				</view>
				<view class="value">
					{{item.end_time}}
				</view>
			</view>
			<view class="detailItem">
				<view class="lable">
					申请结果
				</view>
				<view class="value" style="color: #FF6F6F;">
					{{item.result}}
				</view>
			</view>

		</view>

		<view class="remark-imgBox">
			<view v-if="pageData.remark" class="remarkBox">
				<view class="">
					备注
				</view>
				<view class="copy" @click="handleCopy(pageData.remark)">
					复制
				</view>
			</view>
			<view v-if="pageData.remark" class="remarktext">
				{{pageData.remark}}
			</view>
			<view v-if="pageData.remark_image.length>0" class="imgBox"
				style="margin-top: 20rpx;display: flex;flex-wrap: wrap;">
				<image class="imgitem" v-for="(subitem,subindex) in item.remark_image" :src="subitem" mode=""
					@click="handleimgbig(item.remark_image,index)"></image>
			</view>
		</view>

		<view class="" style="height: 100rpx;"> </view>
	</view>
</template>

<script>
	import {
		useraApplicationDetails
	} from "@/api/api.js"
	export default {
		data() {
			return {
				pageId: "",
				pageName: "",
				pageData: [],
				country: ""
			}
		},
		onLoad(options) {
			// console.log("22222", JSON.parse(options.data))
			this.pageId = options.id
			// this.pageName = JSON.parse(options.data).name
			this.handleGetuseraApplicationDetails()
		},
		methods: {
			//复制
			handleCopy(value) {
				uni.setClipboardData({
					data: value, //要被复制的内容
					success: () => {
						uni.showToast({
							title: '复制成功',
							icon: "none",
							duration: 1800
						});
					}
				});
			},
			async handleGetuseraApplicationDetails() {
				let res = await useraApplicationDetails({
					id: this.pageId,
				})
				this.pageData = res.data
				// this.country = this.pageData[0].country
				this.pageData.remark_image = this.pageData.remark_image ? this.pageData.remark_image.split(",") : []
				// console.log("22", this.pageData.information)
			},
			handleimgbig(imgarr, index) {
				// console.log("imgarr",imgarr)
				uni.previewImage({
					current: index, // 当前显示图片的链接（必填）
					urls: imgarr, // 要预览的图片链接列表（必填）
					success() {
						// console.log('预览图片成功');
					},
					fail(err) {
						// console.log('预览图片失败', err);
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.applicationDetail {
		padding: 30rpx;
		box-sizing: border-box;

		.DetailBox_top {
			width: 690rpx;
			height: 92rpx;
			background: linear-gradient(180deg, #E1E8FD 0%, #FEFEFF 100%);
			display: flex;
			border-radius: 16rpx 16rpx 0rpx 0rpx;
			align-items: center;
			padding-left: 30rpx;
			box-sizing: border-box;
			font-size: 32rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			color: #255A9B;
			line-height: 32rpx;
		}

		.detailMessageBox {
			width: 690rpx;
			// height: 730rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin-bottom: 30rpx;
			padding: 30rpx;
			box-sizing: border-box;

			.detailItem {
				display: flex;
				width: 100%;
				justify-content: space-between;
				border-bottom: 2rpx solid #F4F4F7;
				align-items: center;

				.lable {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #232832;
					line-height: 36rpx;
				}

				.value {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #9E9E9E;
					line-height: 92rpx;
				}
			}


		}

		.detailMessageBox::first-child {
			border-radius: 0rpx 0rpx 16rpx 16rpx;
		}
	}

	.remark-imgBox {
		width: 690rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin-top: 30rpx;
		padding: 30rpx;
		box-sizing: border-box;

		.remarkBox {
			width: 100%;
			display: flex;
			justify-content: space-between;
			margin-bottom: 10rpx;

			.copy {
				width: 64rpx;
				height: 34rpx;
				border: 1rpx solid #BBBBBB;
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #BBBBBB;
				line-height: 34rpx;
				text-align: center;
				border-radius: 8rpx;
			}
		}

		.remarktext {
			width: 100%;
			word-wrap: break-word;
		}

		.imgitem {
			width: 140rpx;
			height: 140rpx;
			border-radius: 10rpx;
			margin-right: 20rpx;
			margin-bottom: 10rpx;
		}

		.imgitem:nth-child(4n) {
			margin-right: 0rpx;
		}
	}
</style>